{# loaded from BXTRLayoutBundle:Front:Header.html.twig #}
<div class="navbar-container">
    <div class="navbar navbar-default" role="navigation">
        <div class="container container-fluid">
            <div class="row">
                <div class="navbar-header">
                    {# navigation button will be displayed if the viewport become too small, the menu will be colapsed #}
                    <button type="button" class="navbar-toggle main-navbar-toggle btn btn-default btn-sm" data-toggle="collapse" data-target="#main-navbar">
                        <span>Navigation</span>
                    </button>
                    <a href="{{ path('bxtr_index') }}" title="Retour à l'index" class="logo" >
                        <img src="{{ asset('bundles/bxtrlayout/image/logo.png') }}" alt="Logo" />
                    </a>

                </div>
                <div class="collapse navbar-collapse" id="main-navbar">
                    <ul class="nav navbar-nav">
                        {# links are generated from the "linklist" array : Array.<path:String, link:String> or Array.<sub:Array.<path:String, link:String>, link:String> #}
                        {% for link in linklist %}
                            {% if link.sub is defined %}
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ link.name|trans }}<b class="caret"></b></a>
                                    <ul class="dropdown-menu">
                                        {% for sublink in link.sub %}
                                            <li>
                                                <a href="{{ path(sublink.path) }}" >{{ sublink.name|trans }}</a>    
                                            </li>
                                        {% endfor %}
                                    </ul>
                                </li>
                            {% else %}
                                <li>
                                    <a href="{{ path(link.path) }}" >{{ link.name }}</a>
                                </li>
                            {% endif %}
                        {% endfor %}
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        <li class="dropdown">
                            <a href="#" role="button" class="dropdown-toogle" data-toggle="dropdown">Langue<b class="caret"></b></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="#">Français</a></li>
                                <li><a href="#">Anglais</a></li>
                            </ul>
                        </li>
                        {% if app.user %}
                            <li>        
                                <a class="btn-lg btn-default" href="{{ path('bxtr_logout') }}" title="Déconnexion">Se déconnecter</a>
                            </li>
                        {% endif %}
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
